<%@ page import="java.util.Date" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>

<script type="text/javascript" src="js/jquery.itextclear.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
        $('input[type=text], input[type=password], input[type=url], input[type=email], input[type=number], textarea', '.form').iTextClear();
    });
</script>
<!-- jQplot CSS -->

<link rel="stylesheet" media="screen" href="css/Tree.css" />
<!-- jQplot CSS END -->

<!-- DATATABLES CSS -->
<link rel="stylesheet" media="screen" href="lib/datatables/css/vpad.css" />
<script type="text/javascript" src="lib/datatables/js/jquery.dataTables.js"></script>
<!-- DATATABLES CSS END -->

<h1 class="page-title">行政签核系统</h1>

<div class="container_12 clearfix leading">
    <section class="tabs grid_12 leading">
        <ul class="clearfix">
            <li><a href="#" id="tab_1" onclick="javascript:window.location.href='#${userType==1?"sign" : "public"}/administration-evection-apply-form.xhtml'">出差申请单</a></li>
            <li><a href="#" id="tab_2" onclick='javascript:window.location.href = "#${userType==1?"sign" : "public"}/administration-evection-report-form.xhtml"'>出差报告单</a></li>
            <li><a href="#" id="tab_3" onclick="javascript:window.location.href='#${userType==1?"sign" : "public"}/administration-evection-cost-apply-form.xhtml'">出差旅费申报单</a></li>
            <li><a href="#" id="tab_4" onclick="javascript:window.location.href='#${userType==1?"sign" : "public"}/administration-out-apply-form.xhtml'">外出申请单</a></li>
            <li><a href="#" id="tab_5" class="current">请假申请单</a></li>
        </ul>
        <section>
            <section class="clearfix" style="display: block;">
                <header class="grid_12 alpha omega">
                    <s:if test="#request.showChildOrg == true">
                        <%@include file="common_organization_duty_choice_bar.jsp"%>
                    </s:if>
                </header>
                <div id="demo" class="clearfix">
                    <table class="display" id="example">
                        <thead>
                        <tr>
                            <th style="text-align:left; width:20px"><input type="checkbox" id="form-updates7"                                                                           value="1"/></th>
                            <th style=" width:70px">流水号</th>
                            <th>员工号</th>
                            <th>申请人</th>
                            <th>请假类型</th>
                            <th style=" width:80px">时间自</th>
                            <th style=" width:80px">时间至</th>
                            <th style=" width:120px">原因描述</th>
                            <th style=" width:110px">审核状态</th>
                        </tr>
                        </thead>
                        <tbody>
                        <s:if test="#request.applyForms == null or #request.applyForms.size() == 0">
                        <tr class="gradeX"><td colspan="11">暂无数据</td></tr>
                        </s:if>
                        <s:iterator value="#request.applyForms" var="af" status="sta">
                        <tr class='grade${sta.even ? "A" : "C"}'>
                            <td><input type="checkbox" id="form-updates" value="1"/></td>
                            <td>${af.serialNumber}</td>
                            <td>${af.work.workNo}</td>
                            <td>${af.work.baseId.name}</td>
                            <td>${af.typeName}</td>
                            <td><s:date name="#request.af.startDate" format="yyyy-MM-dd"/> </td>
                            <td><s:date name="#request.af.endDate" format="yyyy-MM-dd"/> </td>
                            <td>${af.reason}</td>
                            <td>
                                <s:if test="#request.af.status.toString() == 'wait_audit'">
                                <a href="#sign/administration-leave-apply-form-audit.xhtml?applyForm.id=${af.id}&t=<%=new Date()%>" class="button"><span class="icon icon-ok" style="background:url(${ctx}/images/img/error.png)">&nbsp;</span>未审核</a>
                                </s:if>
                                <s:elseif test="#request.af.status.toString() == 'within_audit'">
                                    <a href="#sign/administration-leave-apply-form-audit.xhtml?applyForm.id=${af.id}&t=<%=new Date()%>" class="button"><span class="icon icon-ok" style="background:url(${ctx}/images/img/error.png)">&nbsp;</span>审核中</a>
                                </s:elseif>
                                <s:else>
                                    <a href="#" class="button"><span class="icon icon-ok" style="background:url(${ctx}/images/img/accept.png)">&nbsp;</span>已审核</a>
                                </s:else>
                            </td>
                        </tr>
                        </s:iterator>
                        </tbody>
                    </table>
                </div>
                <div class="tabs side grid_12 leading">
                    <div class="clear"></div>
                    <div class="grid_12">
                        <div class="form-action clearfix">
                            <p><a class="button" href="#${userType==1?"sign" : "public"}/administration-leave-apply-form-input.xhtml?t=<%=new Date()%>"><span style="background:url(${ctx}/images/img/add.png)" class="icon">&nbsp;</span>添加</a>
                            </p>
                        </div>
                    </div>
                </div>
            </section>

            <div class="tabs side grid_12 leading">
                <div class="clear"></div>
            </div>
        </section>
    </section>
</div>
<div class="clear"></div>

<script type="text/javascript" src="js/Tree.js"></script>
<script type="text/javascript">
    $(function(){
        setTimeout('setCurrent()', 600);
    });
    function setCurrent(){
        $("#tab_1").removeClass("current")
        $("#tab_2").removeClass("current")
        $("#tab_3").removeClass("current")
        $("#tab_4").removeClass("current")
        $("#tab_5").addClass("current")
    }
    function doSearch(searchData){
        document.location.href = "#sign/administration-leave-apply-form.xhtml?"+$.param(searchData);
    }
</script>